

{% extends 'base.html' %}

{% block content_main_outer %}
    <h1 class="text-center">这里是后台页面</h1>
    <div class="row">
    <div class="col-md-2">
        <div class="list-group">
            <a href="#" class="list-group-item active">
                操作
            </a>
            <a href="#" class="list-group-item">添加出版社</a>
            <a href="#" class="list-group-item">添加作者</a>
            <a href="#" class="list-group-item">添加作者详情</a>
            <a href="#" class="list-group-item">添加图书信息</a>
        </div>
    </div>
    <div class="col-md-10">
        <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">
            <ul id="myTabs" class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active">
                    <a href="#home" id="home-tab" role="tab" data-toggle="tab"
                       aria-controls="home" aria-expanded="true">出版社信息展示</a>
                </li>
                <li role="presentation">
                    <a href="#profile" role="tab" id="profile-tab" data-toggle="tab"
                       aria-controls="profile">作者信息展示</a>
                </li>
                <li role="presentation">
                    <a href="#book_show" role="tab" id="profile-tab" data-toggle="tab"
                       aria-controls="book_show">图书信息展示</a>
                </li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledby="home-tab">
                </div>
                <div role="tabpanel" class="tab-pane fade" id="profile" aria-labelledby="profile-tab">
                </div>
                <div role="tabpanel" class="tab-pane fade" id="book_show" aria-labelledby="book_show-tab">

                </div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th class = "text = center">出版社名字</th>
                        <th class = "text = center">出版社地址</th>
                        <th class = "text = center">出版社电话</th>
                        <th class = "text = center">出版社书籍列表</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for publish_obj in publish_all %}
                        <tr class="active">
                            <th scope="row">{{ forloop.counter }}</th>
                            <td class = "text = center">{{ publish_obj.name }}</td>
                            <td class = "text = center">{{ publish_obj.addr }}</td>
                            <td class = "text = center">{{ publish_obj.phone }}</td>
                            <td class = "text = center">
                                {% for publish_book_obj in publish_obj.book_set.all %}

                                    {{ publish_book_obj.title }},
                                {% endfor %}
                            </td>

                        </tr>
                    {% endfor %}

                    </tbody>
                </table>

            </div>
        </div>

    </div>



{% endblock %}


</div>